package com.handinglian.ai.callin.enums;

import java.util.Objects;

public enum AiBusinessEnum {
    BIRTH_REGISTRATION("BIRTH_REGISTRATION","出生登记业务"),
    CANCEL_REGISTRATION("CANCEL_REGISTRATION","注销户口业务"),
    REGISTRATION_PROVE("REGISTRATION_PROVE","户籍证明业务"),
    REPLACE_REGISTRATION("REPLACE_REGISTRATION","补办户口业务"),
    IDCARD_APPLY("IDCARD_APPLY","身份证申领业务"),
    IDCARD_EXCHANGE("IDCARD_EXCHANGE","身份证换领业务"),
    ID_CARD_REPLACE("ID_CARD_REPLACE","身份证补领业务");

    public static AiBusinessEnum valueOfOrdinal(Integer ordinal) {
        return Objects.nonNull(ordinal) || ordinal >= values().length ? null : values()[ordinal];
    }
    public static AiBusinessEnum valueOfDesc(String desc) {
        for(AiBusinessEnum recordStateEnum : AiBusinessEnum.values()){
            if(desc.equals(recordStateEnum.getDescription())){
                return recordStateEnum;
            }
        }
        return null;
    }
    public static AiBusinessEnum valueOfKey(String key){
        for(AiBusinessEnum recordStateEnum : AiBusinessEnum.values()){
            if(recordStateEnum.getKey().equals(key)){
                return recordStateEnum;
            }
        }
        return null;
    }
    private final String key;
    private final String description;

    AiBusinessEnum(String key, String description) {
        this.key = key;
        this.description = description;
    }

    public String getKey() {
        return key;
    }
    public String getDescription() {
        return this.description;
    }
}
